<!DOCTYPE html>
<!-- saved from url=(0037)http://127.0.0.1/wx/ybss/zhuce/zc.jsp -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <title>收款</title>

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no, email=no">
  <!--[if IE]>
  <script src="http://127.0.0.1:80/wx/ybss/js/html5shiv.min.js"></script>
  <![endif]-->


  <script type="text/javascript" src="../../script/constants.js"></script>
  <script src="../resource/md5.js"></script>
  <script src="../resource/jquery214.js"></script>
  <script src="../resource/fastclick.js"></script>
  <script src="../resource/jqueryweui.js"></script>
  <script src="../resource/picker.js"></script>
  <script src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/aes.js"></script>
  <script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
  <script type="text/javascript" src="../../script/modeecb.js"></script>
  <script src="../../script/tmd5.js"></script>
  <link rel="stylesheet" href="../../resource/weuimin.css" />
  <script>


  </script>

  <style>

   body {
    overflow-x:hidden;
    margin: 0;
   }
   html {
    overflow-x:hidden;
   }
   
label {cursor:pointer;height:40px;}
label i {font-size:18px;font-style:normal;display:inline-block;width:18px;height:18px;text-align:center;line-height:18px;color:#fff;vertical-align:middle;margin:-2px 2px 1px 0px;border:#2489c5 1px solid;}
input[type="checkbox"] {display:none;}
input[type="checkbox"]:checked + i {background:#2489c5;}
input[type="checkbox"]:disabled + i {border-color:#ccc;}
input[type="checkbox"]:checked:disabled + i {background:#ccc;}
   
   .div_img{
       float: left;
       width: 30%;
       text-align: center;
       height: 160px;
       line-heigth: 160px;
    }
   .store{
       height: 120px;
       width:90%;
       margin: 0 auto;
       background: #27a8fa;
       margin-bottom: 15px;
       border-radius:10px;
       display: table;
   }
   .qrImg{
       width: 80%;
       height: 80%;
       position: relative;
       top: 50%;
       transform: translateY(-50%);
   }
   .addStore{
       width:90%;
       margin:0 auto;
       border:1px dashed #27a8fa;
       height: 60px;
       text-align: center;
       background: #fff;
       border-radius:10px;
       line-height: 60px;
       color: #27a8fa;
   }
     a.btn {
    width: 60px;
    line-height: 25px;
    display: block;
    text-align: center;
    font-size: 12px;
    background: rgba(51,51,51,0.3);
    color: #fff;
    border-radius: 5px;
		}
   .num {
   width: 60px;
   height:25px;
   color: #0000FF
   }
   .keyboard{
	    position: fixed;
	    z-index: 5000;
	    width: 100%;
	    background-color: #f2f2f2;
	    text-align: center;
	    bottom: 0%;
	    overflow: hidden;
   }
   
   .payinfo{
	    position: fixed;
	    z-index: 5000;
	    width: 100%;
	    background-color: #f2f2f2;
	    text-align: center;
	    bottom: 30%;
	    margin: 0 auto;
	    overflow: hidden;
   }
   #cac{   
	    width:100%;
	    height:100%;
	    background: #ffffff;
	    margin:0 auto;
	}
	.c_show{
	    width:90%;
	    height:5%;
	    border:1px solid #EEE9E9;
	    line-height:5%;
	    text-align:right;
	    font-size:50px;
	    color:#000;
	    margin: 0 auto;
	}
	.s_text{
	    width: 100%;
	    height:5%;
	    border:none;
	    line-height:5%;
	    text-align:right;
	    font-size:50px;
	    color:#000;
	}
	#cac h2{    
	    font-size:16px;
	    color:#000;
	    font-weight:500;
	    padding:12px 0 12px 20px;
	    cursor:move;
	}
	.cancel{
	   background-color: #FF6347;
	   color: #ffffff;
	}
	.bkey{
	   background-color: #10AEFF;
	   color: #ffffff;
	}
    .ckey{
       width: 100%;
    }
    .ckey td{
        width:25%;
	    height:3%;
	    text-align:center;
	    line-height:400%;
	    font-size:18px;
	    cursor:pointer;
	    list-style:none;
	    border-top:1px solid #EEE9E9;
	    border-right:1px solid #EEE9E9;
    }
    .ckey td:active{
       background: #27a8fa;
	   color:#fff;
    }
    .payselect {
		border: 0;
		appearance:none;
		background: #fff;
		color: #000;
		outline: medium none;
		width:100%;
		height:100%;
		font-size: 16px;
	}
  </style>

</head>

<body style="background:#F4F4F4;">
<div>
  <div>
       <header id="statusBar">
		<div style="width:100%;display:table;background: #fff;position:fixed;border-bottom:1px solid #EAEAEA;z-index: 9999;height: 50px;" >
			<div style="float:left;width: 20%;height: 50px;line-height: 50px;" tapmode="presshover" onclick="api.closeWin();">
			  <div style="float:left;width: 30%;height: 50px;">
			   <img style="width: 24px;margin-top: 13px;" src="../../image/blc_back.png" />
			   </div>
			   <div style="float:left;width: 50%;">
			   返回
			   </div>
			</div>
			<div style="float:left;width: 60%;height: 50px;line-height: 50px;text-align: center;font-weight:bold;">
			 收款
			</div>
		<!--	<div style="float:right;width: 20%;height: 50px;line-height: 50px;" tapmode="presshover" onclick="rightCorner();">
			  <div style="float:right;width: 50%;">
			  <img style="width: 24px;margin-top: 13px;" src="../../image/jhzf/record.png" />
			   </div>
			</div>-->
		</div>
	</header>
        <div style="height:70px"></div>
        <div id="store_box">
  
        
        </div>
      <!--  <div onclick="addInfo()" tapmode="presshover" class="addStore">
        +添加店铺
        </div> -->
          
</div>
		<div style="bottom:0;margin-top: 20px;width:100%;height:50px;text-align: center;">四川航天信息有限公司</div>
</div>		
<div class="js_dialog" id="iosDialog1" style="opacity: 1;">
            <div class="weui-mask" id="zftc1" tapmode="presshover" style="display: none;" ></div>
              <div class="keyboard" id="zftc" style="display: none;">
  <div id="cac">
        <!-- <table style="margin: 0 auto;vertical-align: middle;">
           <tr>
           <td>支付方式:</td>
           <td style="height: 30px;line-height: 30px;">
             <select class="payselect" id="paytip" style="padding-left: 20px;font-size: 24px;color: #75dc10;" onchange = "changeTip();">
               <option value="00">微信</option>
               <option value="01">支付宝</option>
             </select>
           </td>
           </tr>
        </table> -->
        <div style="width:100%;text-align: center;" id="payeeComments"></div>   
        <div style="height:40px;color: #000;font-size: 16px;text-align: center;width: 100%;">请输入金额</div>
        <div class="c_show">
        
            <input  class="s_text" value="0" id="result"/>
        </div>
        <div style="height:20px;"></div>
        <table class="ckey">
        <tr>
        <td tapmode="presshover" onclick="command(7);">7</td>
        <td tapmode="presshover" onclick="command(8);">8</td>
        <td tapmode="presshover" onclick="command(9);">9</td>
        <td class="bkey" tapmode="presshover" onclick="del('j')">←</td>
        </tr>
        <tr>
        <td tapmode="presshover" onclick="command(4);">4</td>
        <td tapmode="presshover" onclick="command(5);">5</td>
        <td tapmode="presshover" onclick="command(6);">6</td>
        <td class="bkey" tapmode="presshover" onclick="clearzero('j')">清空</td>
        </tr>
        <tr>
        <td tapmode="presshover" onclick="command(1);">1</td>
        <td tapmode="presshover" onclick="command(2);">2</td>
        <td tapmode="presshover" onclick="command(3);">3</td>
        <td class="bkey" tapmode="presshover" onclick="createQr();">确定</td>
        </tr>
        <tr>
        <td tapmode="presshover" onclick="command(0);">0</td>
        <td tapmode="presshover" onclick="command('00');">00</td>
        <td tapmode="presshover" onclick="dot('.')">.</td>
        <td class="cancel" tapmode="presshover" onclick="cancel();">取消</td>
        </tr>
        </table>
          
    </div>
</div>
</div>
<script>
    var merid = "";
	apiready = function(){
	  api.parseTapmode();
	  if(api.systemType == "ios"){
           document.getElementById("statusBar").style.background = "#298cb4";
      }
	  $api.fixStatusBar( $api.dom('header') );
	   var uiId;
       var UILoading = api.require('UILoading');
		UILoading.flower({
		    center: {
		        x: api.winWidth/2.0,          
		        y: api.winHeight/2.0 
		    },
		    size: 30,
		    mask: "rgba(0,0,0,0.5)",
		    fixed: true
		}, function(ret) {
		    uiId = ret.id;
		});
		api.addEventListener({
		    name: 'hideMask'
		}, function(ret, err) {
		    $("#zftc1").hide();
		    api.closeFrame({
			    name: 'receipt'
	        });   
		});
     	var bdid = $api.getStorage("loginid");
     	var callback = function(ret, err){
     	    UILoading.closeFlower({
			    id: uiId
			});
			if(ret){
			if(ret.success){
			var data = ret.list;
			if(data.length > 0){
	     	for(var i=0;i<data.length;i++){
				var s = '<div class="store">'
                        +'<div style="float:left;width: 65%;height: 100%;text-align: center;height: 120px;margin-left:5%;" tapmode="presshover">'
                        +'<div style="height: 80%;position: relative;top: 50%; transform: translateY(-50%);">'
                        +'<div style="margin-bottom: 5px;display: table;width: 100%;">'
                        +'<div style="float: left;color:#fff;font-weight:bold;overflow:hidden;">'+data[i].MC+'</div>'
                        +'</div>'
                        +'<div style="clear: both;"></div>'
                         +'<div style="float: left;">'
                        +'<div style="float:left;color:#fff;margin-top: 3%;">'
                        +'支付方式:'
                        +'</div>'
				        +'<img style="float:left;width: 15%;height: 15%;margin:0;margin-left:5%;" src="../../image/jhzf/wx.png" />'
				        +'<img style="float:left;width: 15%;height: 15%;margin:0;" src="../../image/jhzf/zfb.png" />'
                        +'</div>'
                        +'<div style="clear: both;"></div>'
                        +'<div style="float: left;width:100%;">'
                        +'<div style="float:left;color:#ffffff;margin-top: 3%;text-decoration:underline;" onclick="history(\''+data[i].MEMBERID+'\')">'
                        +'收款记录'
                        +'</div>'
                        +'</div></div></div>'
                        +'<div tapmode="presshover" onclick="addInfo(\''+data[i].ID+'\');" style="float:left;width: 30%;text-align: center;height: 120px;margin-top:18px;">'
                        +'<div style="height:70px"><img style="width:60%;" src="../../image/tabBar/get.png"/></div><div style="color: #fff;margin-top:0px;">收款</div>'
                        +'</div>'
                        +'</div>';
				$("#store_box").append(s);
	         }  
		  }else{
		      var str = "<div style='width:80%;margin:0 auto;'>&nbsp;&nbsp;&nbsp;&nbsp;对不起，您还未开通微信、支付宝二维码便捷收款功能。<br>&nbsp;&nbsp;&nbsp;&nbsp;如需开通，请致电四川航信（95113）。</div>"
		      $("#store_box").append(str);
		  }
		}else{
		  api.alert({msg: ret.msg});
		}
		}else{
		  api.alert({msg: JSON.stringify(err)});
		}
  	  	}
	  var content = {"phone" : '18080188330'};//$api.getStorage("dl_phone")
   	  apiAjax(JSON.stringify(content),url.collection,callback);
     }
     
    function history(memberid){
	     api.openWin({
	         name: 'records',
	         url: './records.html',
	         pageParam: {
	            merid: memberid
	         }
	     });
    }
     
    function rightCorner(){
         var callback = function(data, err){
            var btn = "[";
            if(data){
				if(data.success){
				var list = data.list;
					if(list.length > 0){
			     	  for(var i=0;i<list.length;i++){
                          btn += "'"+list[i].MC+"',"
			          }
			          btn = btn.substring(0,btn.length-1);
			          btn += "]";
                      api.actionSheet({
					    title: '请选择需要查询历史纪录的商户',
					    cancelTitle: '取消',
					    //destructiveTitle: '红色警告按钮',
					    buttons: eval("("+btn+")")
					 }, function(ret, err) {
					    if(ret){
					         var index = ret.buttonIndex;
					         if(index<=list.length){
			                     api.openWin({
				                     name: 'history',
				                     url: './history.html',
				                     pageParam: {
				                        merid: list[index-1].MEMBERID,
				                        merList: list
				                     }
			                     });
		                     }
					    }
					 });  
					}else{
					  api.alert({msg: "未查询到商户信息"});   
					}
				}else{
				  api.alert({msg: data.msg});
				}
			}else{
			  api.alert({msg: JSON.stringify(err)});
			}
      }
      var content = {"phone" : $api.getStorage("dl_phone")};//$api.getStorage("dl_phone")
      apiAjax(JSON.stringify(content),url.collection,callback);
	}
     
     function changeTip(){
         var value = $("#paytip").val();
         if("01" == value){
            document.getElementById("paytip").style.color = "#1296db";
         }else{
            document.getElementById("paytip").style.color = "#75dc10";
         }
     }
     
     function createQr(){
        var amount = $("#result").val();
        var getip = api.require('ipAddress');
			getip.getIp(
			function(ret, err) {
			    var ip = ret.ip;
			    var callback = function(ret, err){
			            if(ret){
			            console.log("qrstring:"+ret.qrString);
			               if(ret.success){
			                   hideKeyb();
                               api.openFrame({
	                               name: 'receipt',
	                               url: './receipt.html',
	                               rect: {
		                               x:0,
		                               y:200,
		                               w:'auto',
		                               h:'auto'
	                               },
	                               pageParam: {
	                                    qrString : ret.qrString,
	                                    orderid : ret.orderid,
	                                    amount : amount,
	                                    ip : ip,
	                                    mid : merid
	                               }
                               });
			               }else{
			                   api.alert({msg: ret.msg});
			               }
			            }
			        }
			    var parameter = {"mid":merid,"phone":$api.getStorage("dl_phone"),"ip":ip,"total":$("#result").val()};
			    apiAjax(JSON.stringify(parameter),url.createQr,callback);
			});
     }
     
     function addInfo(mid){
        merid = mid;
        $("#zftc1").show();
		$("#zftc").show();
     }
     
     function command(num){  
        var str = $("#result").val();
        str = (str == "0" ? "":str);
        str += num;
        $("#result").val(str);
    }
    
    function clearzero(){   
        $("#result").val(0);
    }
    
	function del(m){
	        var str = $("#result").val();
	        str = str.substring(0,str.length - 1);
	        str = (str == "" ? 0 : str);
	       $("#result").val(str);
    }
    function dot(m){
	        var str = $("#result").val();
	        if(str.length!=0){
	        str = str+m
	        }
	       
	       $("#result").val(str);
    }
    
    function cancel(){
         $("#zftc1").hide();
		 $("#zftc").hide();
		 clearzero('j');
    }
    
    function hideKeyb(){
        $("#zftc").hide();
		clearzero('j');
    }
	
	$("#zftc1").click(function(event){  
          event.stopPropagation();//不会打印1，但是页面会跳转；     
          api.closeFrame({
			    name: 'receipt'
	      });        
          $("#zftc1").hide();
		  $("#zftc").hide();
		  clearzero('j'); 
    });  
</script>



</body></html>
